package com.study.jvm.stringtable;

public class StringTable {
    public static void main(String[] args) {
        String a = "a";
        String b = "b";
        String ab = "ab";
        System.out.println("ab = " + a);
        System.out.println("ab = " + b);
        System.out.println("ab = " + ab);
    }
}
/**
 javap -v StringTable.class

 Classfile /E:/Project/Java_Road_Map/build/classes/java/main/com/study/jvm/StringTable.class
 Last modified 2023-6-27; size 872 bytes
 MD5 checksum d006f3694caf53dab73be341bd6adf30
 Compiled from "StringTable.java"
 public class com.study.jvm.stringtable.StringTable
 minor version: 0
 major version: 52
 flags: ACC_PUBLIC, ACC_SUPER
 Constant pool:
 #1 = Methodref          #13.#31        // java/lang/Object."<init>":()V
 #2 = String             #25            // a
 #3 = String             #27            // b
 #4 = String             #28            // ab
 #5 = Fieldref           #32.#33        // java/lang/System.out:Ljava/io/PrintStream;
 #6 = Class              #34            // java/lang/StringBuilder
 #7 = Methodref          #6.#31         // java/lang/StringBuilder."<init>":()V
 #8 = String             #35            // ab =
 #9 = Methodref          #6.#36         // java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
 #10 = Methodref          #6.#37         // java/lang/StringBuilder.toString:()Ljava/lang/String;
 #11 = Methodref          #38.#39        // java/io/PrintStream.println:(Ljava/lang/String;)V
 #12 = Class              #40            // com/study/jvm/StringTable
 #13 = Class              #41            // java/lang/Object
 #14 = Utf8               <init>
 #15 = Utf8               ()V
 #16 = Utf8               Code
 #17 = Utf8               LineNumberTable
 #18 = Utf8               LocalVariableTable
 #19 = Utf8               this
 #20 = Utf8               Lcom/study/jvm/StringTable;
 #21 = Utf8               main
 #22 = Utf8               ([Ljava/lang/String;)V
 #23 = Utf8               args
 #24 = Utf8               [Ljava/lang/String;
 #25 = Utf8               a
 #26 = Utf8               Ljava/lang/String;
 #27 = Utf8               b
 #28 = Utf8               ab
 #29 = Utf8               SourceFile
 #30 = Utf8               StringTable.java
 #31 = NameAndType        #14:#15        // "<init>":()V
 #32 = Class              #42            // java/lang/System
 #33 = NameAndType        #43:#44        // out:Ljava/io/PrintStream;
 #34 = Utf8               java/lang/StringBuilder
 #35 = Utf8               ab =
 #36 = NameAndType        #45:#46        // append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
 #37 = NameAndType        #47:#48        // toString:()Ljava/lang/String;
 #38 = Class              #49            // java/io/PrintStream
 #39 = NameAndType        #50:#51        // println:(Ljava/lang/String;)V
 #40 = Utf8               com/study/jvm/StringTable
 #41 = Utf8               java/lang/Object
 #42 = Utf8               java/lang/System
 #43 = Utf8               out
 #44 = Utf8               Ljava/io/PrintStream;
 #45 = Utf8               append
 #46 = Utf8               (Ljava/lang/String;)Ljava/lang/StringBuilder;
 #47 = Utf8               toString
 #48 = Utf8               ()Ljava/lang/String;
 #49 = Utf8               java/io/PrintStream
 #50 = Utf8               println
 #51 = Utf8               (Ljava/lang/String;)V
 {
 public com.study.jvm.stringtable.StringTable();
 descriptor: ()V
 flags: ACC_PUBLIC
 Code:
 stack=1, locals=1, args_size=1
 0: aload_0
 1: invokespecial #1                  // Method java/lang/Object."<init>":()V
 4: return
 LineNumberTable:
 line 3: 0
 LocalVariableTable:
 Start  Length  Slot  Name   Signature
 0       5     0  this   Lcom/study/jvm/StringTable;

 public static void main(java.lang.String[]);
 descriptor: ([Ljava/lang/String;)V
 flags: ACC_PUBLIC, ACC_STATIC
 Code:
 stack=3, locals=4, args_size=1
 0: ldc           #2                  // String a
 2: astore_1
 3: ldc           #3                  // String b
 5: astore_2
 6: ldc           #4                  // String ab
 8: astore_3
 9: getstatic     #5                  // Field java/lang/System.out:Ljava/io/PrintStream;
 12: new           #6                  // class java/lang/StringBuilder
 15: dup
 16: invokespecial #7                  // Method java/lang/StringBuilder."<init>":()V
 19: ldc           #8                  // String ab =
 21: invokevirtual #9                  // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
 24: aload_1
 25: invokevirtual #9                  // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
 28: invokevirtual #10                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
 31: invokevirtual #11                 // Method java/io/PrintStream.println:(Ljava/lang/String;)V
 34: getstatic     #5                  // Field java/lang/System.out:Ljava/io/PrintStream;
 37: new           #6                  // class java/lang/StringBuilder
 40: dup
 41: invokespecial #7                  // Method java/lang/StringBuilder."<init>":()V
 44: ldc           #8                  // String ab =
 46: invokevirtual #9                  // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
 49: aload_2
 50: invokevirtual #9                  // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
 53: invokevirtual #10                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
 56: invokevirtual #11                 // Method java/io/PrintStream.println:(Ljava/lang/String;)V
 59: getstatic     #5                  // Field java/lang/System.out:Ljava/io/PrintStream;
 62: new           #6                  // class java/lang/StringBuilder
 65: dup
 66: invokespecial #7                  // Method java/lang/StringBuilder."<init>":()V
 69: ldc           #8                  // String ab =
 71: invokevirtual #9                  // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
 74: aload_3
 75: invokevirtual #9                  // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
 78: invokevirtual #10                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
 81: invokevirtual #11                 // Method java/io/PrintStream.println:(Ljava/lang/String;)V
 84: return
 LineNumberTable:
 line 5: 0
 line 6: 3
 line 7: 6
 line 8: 9
 line 9: 34
 line 10: 59
 line 11: 84
 LocalVariableTable:
 Start  Length  Slot  Name   Signature
 0      85     0  args   [Ljava/lang/String;
 3      82     1     a   Ljava/lang/String;
 6      79     2     b   Ljava/lang/String;
 9      76     3    ab   Ljava/lang/String;
 }
 SourceFile: "StringTable.java"

 */